package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.search.vos.SearchArticleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {

    /**
     * @param type   1加载更多    2加载最新
     * @param dto
     * @return
     */
    List<ApArticle> loadArticle(@Param("type") Short type,
                                @Param("dto") ArticleHomeDto dto);

    /**
     * 查询文章   导入es
     * @return
     */
    List<SearchArticleVo> loadArticleToES();

    /**
     * 查询 发布的文章   近几天
     * @param date
     * @return
     */
    List<ApArticle> loadArticleListByDate(Date date);
}
